﻿@model List<Round>

@{
    ViewBag.Title = "Runder";
}

<div class="page-header">
    <h1><span class="glyphicon glyphicon-list"></span>&nbsp;@ViewBag.Title</h1>
</div>
<p>
    @Html.ActionLink("opret ny runde", "Create")
</p>
<table class="table table-hover">
    <thead>
        <tr>
            <th></th>
            <th>dato</th>
            <th>bane</th>
            <th>event</th>
            <th>privat?</th>
        </tr>
    </thead>
    <tbody>
        @foreach (var item in Model)
        {
            <tr>
                <td>
                    @if (item.EditingAllowed())
                    {
                        @Html.ActionLink("ret", "Edit", new { Id = item.Id })
                    }
                </td>
                <td>
                    @item.DateEntry.ToLongDateString()
                </td>
                <td>
                    @Html.ActionLink(item.Course.Name, "Details", new { Id = item.Id })
                </td>
                <td>
                    @(item.Event == null ? "" : item.Event.Name)
                </td>
                <td>
                    @(item.IsPrivate ? "Ja" : "")
                </td>
            </tr>
        }
    </tbody>
</table>
